<html lang="en">
    <head>
        <title>joncalhoun.info - Home</title>
        <link rel="stylesheet" href="css/menu.css" type="text/css" media="screen" />
    </head>
    <body>
        <?php
        function curPageName() {
            return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
        }
        $curPage = curPageName();
        echo "The current page name is <br><br>".curPageName();
        echo "<br><br>";


        class MenuItem {
            public $url, $name;
            function __construct($u, $n) {
                $this->url = $u;
                $this->name = $n;
            }
            function __destruct() {
            }
            function printLI($curPage) {
                if($curPage == $this->url) {
                    echo "<li id=\"selected\"><a href=\"" . $this->url . "\">" . $this->name . "</a></li>";
                } else {
                    echo "<li><a href=\"" . $this->url . "\">" . $this->name . "</a></li>";
                }
            }

        }
        $omg1 = "index.php";
        $omg2 = "Home";
        $menuItems = array(
            new MenuItem($omg1, $omg2),
            new MenuItem('#', "Item 1"),
            new MenuItem("#", "Item 2"),
            new MenuItem("tempMenu.php", "Menu Testing"),
            new MenuItem("http://net.tutsplus.com/", "Nettuts"),
            new MenuItem("contact.php", "Contact"),
            new MenuItem("login.php", "Login"),
            new MenuItem("register.php", "Register"),
        );

        echo "
        <div id=\"container\">
          <ul id=\"nav\">";

        

        foreach($menuItems as $cur) {
            $cur->printLI($curPage);
        }
        echo "</ul>
        </div>";
        ?>

        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"
            type="text/javascript"></script>
        <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"
            type="text/javascript"></script>

        <script type="text/javascript" src="js/jquery.menuEffect.js"></script>

        <script type="text/javascript">
            $('#nav').menuEffect();
        </script>

    </body>
</html>